
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 2
 * @Author : WangRuoyu 
 * @Date : 2023/5/15 9:02
 */

#include "iostream"
#include "algorithm"

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int stus[n + 1];
    int index[n + 1];
    for (int i = 0; i <= n; ++i) {
        stus[i] = i;
        index[i] = i;
    }
    for (int i = 0; i < m; ++i) {
        int d, k;
        cin >> d >> k;
        int idx = index[d];
        int tmp = stus[idx];
        if (k > 0) {
            for (int j = idx; j < idx + k; ++j) {
                stus[j] = stus[j + 1];
                index[stus[j]] = j;
            }
        } else {
            for (int j = idx; j > idx + k; --j) {
                stus[j] = stus[j - 1];
                index[stus[j]] = j;
            }
        }
        stus[idx + k] = tmp;
        index[tmp] = idx + k;
    }
    for (int i = 1; i <= n; ++i) {
        cout << stus[i] << " ";
    }
    return 0;
}